{% extends "../admin/ext_admin.html" %}
{% block extadmin %}
<section class="panel panel-default">
    <header class="panel-heading text-right bg-light  clearfix">
        <ul class="nav nav-tabs pull-left">
            <li class="active"><a  href="/{{ctx.controller}}/type">分类管理</a></li>
        </ul>
        <span class="hidden-sm"><a href="/{{ctx.controller}}/typeadd" class="text-info " data-toggle="ajaxModal">添加类别</a></span>
    </header>
    {#
    <div class="row wrapper">

        <div class="col-sm-12 m-b-xs">
            <div class="btn-group" >
                <a href="/{{ctx.controller}}/index" class="btn btn-sm btn-default {%if typeid == 0%}active{%endif%}">
                    全部
                </a>
                {%for t in type%}
                <a href="/{{ctx.controller}}/index/?typeid={{t.typeid}}" class="btn btn-sm btn-default {%if typeid == t.typeid%}active{%endif%}">
                    {{t.name}}
                </a>
                {%endfor%}
            </div>
        </div>
    </div>
    #}
    <div class="table-responsive">
        <table class="table table-striped b-t b-light">
            <thead>
            <tr>
                <th style="width:20px;"><label class="checkbox m-n i-checks"><input type="checkbox"><i></i></label></th>
                <th style="width:80px;">排序</th>
                <th style="">分类名称</th>
                <th class="">分类ID</th>
                <th >操作</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td></td>
                <td></td>
                <td>默认分类</td>
                <td>0</td>
                <td></td>

            </tr>
            {% for item in list %}
            <tr>
                <td><label class="checkbox m-n i-checks"><input class="ids" type="checkbox" name="ids" value="{{item.typeid}}"><i></i></label></td>
                <td><input class="form-control form-control-text sort" value="{{item.sort}}" name="sort" data-id="{{item.typeid}}"/></td>
                <td>{{item.name}}</td>
                <td>{{item.typeid}}</td>
                <td>

                    <a href="/{{ctx.controller}}/typeedit/?id={{item.typeid}}" class="text-info" data-toggle="ajaxModal">修改</a>
                    <a href="/{{ctx.controller}}/typedel/?ids={{item.typeid}}" class="confirm ajax-get text-info">删除</a></td>

            </tr>

            {% endfor %}


            </tbody>
        </table>
    </div>
    <footer class="panel-footer">
        <div class="row">

            <div class="col-sm-6 text-center-xs">
                <div class="btn-group">
                    <a href="/{{ctx.controller}}/typesort" class="btn btn-default ajax-post" target-form="sort">排序</a>
                    <a href="/{{ctx.controller}}/typedel" class="btn btn-default ajax-post confirm" target-form="ids">删除</a>
                </div>
            </div>

            <div class="col-sm-6 text-right text-center-xs">
                {{pagerData | safe}}
            </div>
        </div>
    </footer>
</section>
{% endblock %}
